<html>
<head><meta charset="utf-8"><title>libc no-std · t-libs · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/index.html">t-libs</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/libc.20no-std.html">libc no-std</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="233059875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/libc%20no-std/near/233059875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ender <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/libc.20no-std.html#233059875">(Apr 04 2021 at 06:11)</a>:</h4>
<p>I may be having this issue due to a lack of understanding with respect to libc. I cannot manage to build libc in a no-std setting. </p>
<p>I thought I would look at the assembly for each libc function (using cargo-asm). I noticed that the assembly was making references to std, so I tried to build without the standard library. </p>
<p>I simply cloned the libc repo and ran <code>cargo build --no-default-features</code> inside the root. This was not successful.</p>



<a name="233064964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/libc%20no-std/near/233064964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/libc.20no-std.html#233064964">(Apr 04 2021 at 08:01)</a>:</h4>
<p>Which std functions are referenced?</p>



<a name="233065017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/libc%20no-std/near/233065017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/libc.20no-std.html#233065017">(Apr 04 2021 at 08:02)</a>:</h4>
<blockquote>
<p>I simply cloned the libc repo and ran cargo build --no-default-features inside the root. This was not successful.</p>
</blockquote>
<p><span class="user-mention" data-user-id="341972">@ender</span> Was there a build error? And if so what was the error?</p>



<a name="233065121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/libc%20no-std/near/233065121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/libc.20no-std.html#233065121">(Apr 04 2021 at 08:04)</a>:</h4>
<p><code>cargo build --no-default-features</code> works for me.</p>



<a name="233065134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/libc%20no-std/near/233065134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/libc.20no-std.html#233065134">(Apr 04 2021 at 08:04)</a>:</h4>
<p>What platform are you on?</p>



<a name="233065866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/libc%20no-std/near/233065866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ender <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/libc.20no-std.html#233065866">(Apr 04 2021 at 08:20)</a>:</h4>
<p>I cloned the repo again and had no issues building as described. I think the issue is that I had actually edited the repo before trying to build previously. No issues are present<br>
.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>